home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 1ISBU7O (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.2 KB  |  24 lines

  1. package com.sun.java.swing.text;
  2.  
  3. import java.awt.Component;
  4. import java.awt.event.ActionEvent;
  5.  
  6. public class DefaultEditorKit$InsertContentAction extends TextAction {
  7.    public DefaultEditorKit$InsertContentAction() {
  8.       super("insert-content");
  9.    }
  10.  
  11.    public void actionPerformed(ActionEvent e) {
  12.       JTextComponent target = ((TextAction)this).getTextComponent(e);
  13.       if (target != null && e != null) {
  14.          String content = e.getActionCommand();
  15.          if (content != null) {
  16.             target.replaceSelection(content);
  17.          } else {
  18.             ((Component)target).getToolkit().beep();
  19.          }
  20.       }
  21.  
  22.    }
  23. }
  24.